package com.mmdccj.yugu.mapper;

import com.mmdccj.yugu.entity.SingerInfo;
import com.mmdccj.yugu.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: MMDCCJ
 * @date: 2023-12-08 21:39
 */
@Mapper
public interface SingerInfoMapper {
    @Select("SELECT * FROM singer_info WHERE user_id = #{user_id}")
    SingerInfo getSingerInfo(String user_id);

    @Select("SELECT COUNT(*) FROM singer_info")
    int getInfoNums();

    @Select("SELECT u.name,u.id,u.avatar FROM singer_info info join user u ON u.id=info.user_id")
    List<User> getAllSingerInfo();
}
